import entryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory';

import {
  is
} from 'bpmn-js/lib/util/ModelUtil';


export default function (group, element, translate) {

  // Only return an entry, if the currently selected
  // element is a start event.

  if (is(element, 'bpmn:Process') || is(element, 'bpmn:Task')) {
    group.entries.push(entryFactory.textField({
      id: 'candidateGroup',
      description: translate('Describe For Candidate Groups'),
      label: translate('Candidate Groups'),
      modelProperty: is(element, 'bpmn:Process') ? 'flowable:candidateStarterGroups' : 'flowable:candidateGroups'
    }));
  }
}
